# -*- coding: utf-8 -*-
# @Time         : 14:26 2025/2/26
# @Author       : Chris
# @Description  :
from typing import List, Optional

from .._models import BaseModel


class Goods(BaseModel):
    """商品信息"""
    images: List[str]
    """商品主图"""

    item_id: int
    """闲鱼商品ID"""

    outer_id: str
    """商家编码"""

    price: int
    """商品单价（分）"""

    product_id: int
    """管家商品ID"""

    quantity: int
    """购买数量"""

    service_support: str
    """商品服务项"""

    sku_id: int
    """管家SKU规格ID"""

    sku_outer_id: str
    """商家SKU编码"""

    sku_text: str
    """SKU规格"""

    title: str
    """商品标题"""


class OrderDetail(BaseModel):
    """订单详情"""
    buyer_eid: str
    """买家标识, 闲鱼体系内唯一的用户标识"""

    buyer_nick: str
    """买家昵称"""

    cancel_reason: str
    """订单取消原因"""

    cancel_time: int
    """订单取消时间"""

    confirm_time: int
    """订单成交时间"""

    consign_time: int
    """订单发货时间"""

    consign_type: int
    """订单发货类型, 枚举值：
    1 : 物流发货
    2 : 虚拟发货
    """

    create_time: int
    """订单创建时间"""

    express_code: str
    """快递公司代码"""

    express_fee: int
    """运费（分）"""

    express_name: str
    """快递公司名称"""

    goods: Goods
    """商品信息"""

    idle_biz_type: int
    """子业务类型, 枚举值：
    20：拼团订单
    """

    order_no: str
    """闲鱼订单号"""

    order_status: int
    """订单状态"""

    order_time: int
    """买家下单时间"""

    order_type: int
    """订单类型"""

    pay_amount: int
    """订单实付金额（分）"""

    pay_no: str
    """支付宝交易号"""

    pay_time: int
    """订单支付时间"""

    pin_group_status: int
    """拼团状态, 枚举值：
    1：拼团中
    2：拼团成功
    3：拼团超时
    """

    refund_status: int
    """订单退款状态"""

    refund_time: int
    """订单退款时间, 仅退款成功有值"""

    seller_eid: str
    """卖家标识, 与闲鱼店铺`user_identity`字段一致（闲鱼内唯一且不变）"""

    seller_name: str
    """卖家会员名, 与闲鱼店铺`user_name`字段一致（存在变更的可能性）"""

    seller_remark: str
    """卖家备注"""

    total_amount: int
    """订单下单金额（分）"""

    update_time: int
    """订单更新时间"""

    waybill_no: str
    """快递单号"""

    address: Optional[str] = None
    """收货详细地址, 仅待发货状态返回"""

    area_name: Optional[str] = None
    """收货地区, 仅待发货状态返回"""

    city_name: Optional[str] = None
    """收货城市, 仅待发货状态返回"""

    prov_name: Optional[str] = None
    """收货省份, 仅待发货状态返回"""

    receiver_mobile: Optional[str] = None
    """收货人号码, 仅待发货状态返回"""

    receiver_name: Optional[str] = None
    """收货人姓名, 仅待发货状态返回"""

    town_name: Optional[str] = None
    """收货街道, 仅待发货状态返回"""
